Zapier
Note:' There are two versions of the Zapier Habitica integration and this page describes the unofficial one. According to the the developer of the unofficial version, the official version should be used instead and the unofficial version will be deleted (see Trello card). This page will need to be reworked to be about the official version. See this Habitica Developer Blog post for information about getting started using the official version. If you are interested in working on this page and have any questions, use the Talk page or visit the Wizards of the Wiki guild. --Sonnet73 (talk) 03:28, March 9, 2017 (UTC) ---- Tips & Tricks General * Because Zapier fetches data periodically (every 5 to 15 minutes), party chats may appear out of order if two or more chat messages get posted during that time. For example, a 12:54pm message may be fetched before a 12:51pm message. * For the New Party (Guild) Chat trigger, one or more messages must already exist in the party or guild when setting up the Zap. Otherwise, the trigger will fail. * When creating tasks, the Due Date needs to be changed to the UTC time zone in order to appear correctly on the website. * Currently, the Due Date for Create Tasks is not populating correctly for the app (but will show correctly on the website). To fix this, just update the date manually. * Zapier does not support two-way syncing at the moment. Thus, keeping records up to date after the initial Trigger and Action is not currently supported. Think of Zaps as one-way, one-time actions. For more information, see this official article from Zapier. Google Sheets * Google Sheets must: ** have a header record on the first row ** not have any blank rows between any records * Times in Habitica are stored in Epoch time. To show correctly in Google Sheets, use the appropriate time-date formatting and: ** To convert to UTC, add ts in front of the Time field. For example, tsTimestamp. Note: no equal sign is used. ** To convert to your local time, use =Timestamp/86400000+"1 Jan 1970"+Adjustment/24, where the Adjustment is the number of hours ahead of or behind GMT. For example, PDT is GMT -7, so the formula will be =Timestamp/86400000+"1 Jan 1970" + -7/24. * When using Create Task Action to convert Due Dates to the correct UTC format, use the following formula: =Field with Date+(Adjustment/24). For example, if the time zone is PDT (GMT -7) and the date field is in C2, then the formula will be =C2+(-7/24) Samples Copy Party/Guild Chat into Google Sheets # Create a Google Sheet with the column headings you wish to capture, like Name, Level, Timedatestamp, and Text. # Format the Timedatestamp field using the appropriate time-date formatting. # Go to the Zapier Dashboard. Choose Make a Zap. # Choose Habitica as the Trigger App. # Choose New Party Chat and Save + Continue. # If not already completed, choose Connect to New Account and fill out your UID and API Token, which can be found on the Habitica website via Settings > API. # Select the account and click Save + Continue. # Select either your party or a guild and click Continue. # Ensure there is at least one message in the selected party/guild's chat. Click Fetch & Continue. # You should get a message saying, "Test Successful!". '''''If you do not, please check that there is at least one line of chat in the party/guild selected. You can see the results by clicking View Your Chat, which will display the last line in the guild. Click Continue. # Choose Google Sheets as your action. # Choose Create Spreadsheet Row. # If not already completed, choose Connect to New Account and fill out your Google username and password. # Select the Account and click Save + Continue. # Select the Spreadsheet and appropriate Worksheet. # Fill out Column Details: (These columns may not appear in the same order) #* Date/time: =1 Timestamp/86400000+"1 Jan 1970" + -7/24 for PDT(GMT-7). Please see Tips & Tricks For Google Sheets for more about formatting timestamps. #* Name: 1 User Name #* Level: 1 Contributor Level: 1 Contributor Text #* Text: 1 Text # Click Continue. # You can Test Google Sheets by inserting the last line of chat into your spreadsheet. Click Create & Continue. # You should get a message saying, "Test Successful!" If you do not, please check that there are no blank rows between any records. # Open your spreadsheets and review your results. #* The first row may read, "Added by Zapier, ensuring we can access this spreadsheet. Feel free to delete it after you are all set up!" You can delete this row. (Do not just clear the content, but remove the entire row; otherwise, your Zap will stop populating!) #* The next line will be the automatically entered line of chat. # Click Finish. # Name your Zap and click Your Zap Is On for it to start collecting data. Load New To-Dos from Google Sheets This method shows how to load To-Dos when a new row is created. Therefore if there is already an existing list, or if you wish to edit the To-Dos before uploading, edit in a separate document first, and then paste the row into a Google Sheet once the Zap is on. # Create a Google Sheet with the following headings: Task Name, Notes, Actual Due Date, UTC Due Date. # Format the Due Date fields with appropriate time-date formatting. # Fill out the Task Name, Notes and Actual Due Date. Only add one To-Do row as subsequent rows will be ignored and not loaded. Add these tasks after creating the Zap. # In the UTC Due Date Field, use =C2+(-7/24) for PDT(GMT-7). # Go to the Zapier Dashboard. Choose Make a Zap. # Choose Google Sheets as the Trigger App. # Choose the Trigger as New Spreadsheet Row and click Save + Continue. # If not already completed, choose Connect to New Account and fill out your Google username and password. # Select the Account and choose Save + Continue. # Select the Spreadsheet and appropriate Worksheet and click Continue. # Click Fetch & Continue to confirm that it is able to read one task. # You can view the spreadsheet row to confirm the data is correct. Click Continue once done. # Choose Habitica as the Action App. # Choose Create Task as your option and click Save + Continue # If not already completed, Choose Connect to New Account and fill out your UID and API Token which can be found on the Habitica website via Settings > API. # Select the account and click Save + Continue. # Fill out Column Details: #* Type: To-Do #* Task: 1 taskname #* Notes: 1 notes #* Due Date: 1 utcduedate # Click Continue. # Review it is correct and click Create & Continue # Sync your Habitica Account on the App or Website and review your new task. # Click Finish. # Name your Zap and click Your Zap Is On. # Add new rows for new To-Dos as desired, ensuring the UTC Due Date column is populated appropriately. Add Completed Tasks to Your RescueTime A premium RescueTime account is required for this (direct link). # Go to the Zapier Dashboard. Choose Make a Zap. # Choose Habitica as the Trigger App. # Choose Score Task click Save + Continue. # If not already completed, Choose Connect to New Account and fill out your UID and API Token which can be found on the Habitica website via Settings > API. # Select the account and click Save + Continue. # Click Continue if Test is Successful. # Choose RescueTime as the Action App. # Choose Log a Highlight Event. Click Save + Continue. # If not already completed, choose connect to new account and fill out your RescueTime username and password. # Select the Account and click Save + Continue. # Fill out Column Details: #* Date/Time: 1 Updated At #* Description: 1 Task Text was scored 1 Direction. Completion: 1 Task Completed #* Action Label: Habitica # Click Continue. # Review it is correct and click Create & Continue. # Click Finish. # Name your Zap and click Your Zap Is On. en:Zapier カテゴリ:拡張機能・アドオン・カスタマイズ